<?php

/**
 * juicios actions.
 *
 * @package    sgcj
 * @subpackage juicios
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 9301 2008-05-27 01:08:46Z dwhittle $
 */
class juiciosActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex()
  {
  }
  
  public function executeIndexcausa()
  {
  }
  
  public function executeListcausa()
  {
    $this->causaList = CausaPeer::doSelect(new Criteria());
  }
  
  public function executeShowcausa($request)
  {
    $this->causa = CausaPeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->causa);
  }

  public function executeCreatecausa()
  {
    $this->form = new CausaForm();

    $this->setTemplate('editcausa');
  }

  public function executeEditcausa($request)
  {
    $this->form = new CausaForm(CausaPeer::retrieveByPk($request->getParameter('id')));
  }

  public function executeUpdatecausa($request)
  {
    $this->forward404Unless($request->isMethod('post'));

    $this->form = new CausaForm(CausaPeer::retrieveByPk($request->getParameter('id')));

    $this->form->bind($request->getParameter('causa'));
    if ($this->form->isValid())
    {
      $causa = $this->form->save();

      $this->redirect('juicios/indexcausa');
    }

    $this->setTemplate('editcausa');
  }

  public function executeDeletecausa($request)
  {
    $this->forward404Unless($causa = CausaPeer::retrieveByPk($request->getParameter('id')));

    $causa->delete();

    $this->redirect('juicios/indexcausa');
  }
  
  public function executeIndexdiligencia()
  {
  }

  public function executeListdiligencia()
  {
    $this->diligenciaList = DiligenciaPeer::doSelect(new Criteria());
  }

  public function executeShowdiligencia($request)
  {
    $this->diligencia = DiligenciaPeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->diligencia);
  }

  public function executeCreatediligencia()
  {
    $this->form = new DiligenciaForm();

    $this->setTemplate('editdiligencia');
  }

  public function executeEditdiligencia($request)
  {
    $this->form = new DiligenciaForm(DiligenciaPeer::retrieveByPk($request->getParameter('id')));
  }

  public function executeUpdatediligencia($request)
  {
    $this->forward404Unless($request->isMethod('post'));

    $this->form = new DiligenciaForm(DiligenciaPeer::retrieveByPk($request->getParameter('id')));

    $this->form->bind($request->getParameter('diligencia'));
    if ($this->form->isValid())
    {
      $diligencia = $this->form->save();

      $this->redirect('juicios/editdiligencia?id='.$diligencia->getId());
    }

    $this->setTemplate('editdiligencia');
  }

  public function executeDeletediligencia($request)
  {
    $this->forward404Unless($diligencia = DiligenciaPeer::retrieveByPk($request->getParameter('id')));

    $diligencia->delete();

    $this->redirect('juicios/indexdiligencia');
  }
  
  public function executeIndexabono()
  {
  }
  
  public function executeListabono()
  {
    $this->abonoList = AbonoPeer::doSelect(new Criteria());
  }

  public function executeShowabono($request)
  {
    $this->abono = AbonoPeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->abono);
  }

  public function executeCreateabono()
  {
    $this->form = new AbonoForm();

    $this->setTemplate('editabono');
  }

  public function executeEditabono($request)
  {
    $this->form = new AbonoForm(AbonoPeer::retrieveByPk($request->getParameter('id')));
  }

  public function executeUpdateabono($request)
  {
    $this->forward404Unless($request->isMethod('post'));

    $this->form = new AbonoForm(AbonoPeer::retrieveByPk($request->getParameter('id')));

    $this->form->bind($request->getParameter('abono'));
    if ($this->form->isValid())
    {
      $abono = $this->form->save();

      $this->redirect('juicios/indexabono');
    }

    $this->setTemplate('editabono');
  }

  public function executeDeleteabono($request)
  {
    $this->forward404Unless($abono = AbonoPeer::retrieveByPk($request->getParameter('id')));

    $abono->delete();

    $this->redirect('juicios/indexabono');
  }

  public function executeIndexgasto()
  {
  }
  
  public function executeListgasto()
  {
    $this->gastoList = GastoPeer::doSelect(new Criteria());
  }

  public function executeShowgasto($request)
  {
    $this->gasto = GastoPeer::retrieveByPk($request->getParameter('id'));
    $this->forward404Unless($this->gasto);
  }

  public function executeCreategasto()
  {
    $this->form = new GastoForm();

    $this->setTemplate('editgasto');
  }

  public function executeEditgasto($request)
  {
    $this->form = new GastoForm(GastoPeer::retrieveByPk($request->getParameter('id')));
  }

  public function executeUpdategasto($request)
  {
    $this->forward404Unless($request->isMethod('post'));

    $this->form = new GastoForm(GastoPeer::retrieveByPk($request->getParameter('id')));

    $this->form->bind($request->getParameter('gasto'));
    if ($this->form->isValid())
    {
      $gasto = $this->form->save();

      $this->redirect('juicios/indexgasto');
    }

    $this->setTemplate('editgasto');
  }

  public function executeDeletegasto($request)
  {
    $this->forward404Unless($gasto = GastoPeer::retrieveByPk($request->getParameter('id')));

    $gasto->delete();

    $this->redirect('juicios/indexgasto');
  }
}
  
  